public class WorkDemo {

    public static double getBMI(double weight, double height) {
        double bmiVaule = 0;
        bmiVaule = weight / (height * height);
        return bmiVaule;
    }

    public static String getWeightLevel(double bmi) {
        String strLevel = "";
        if (bmi < 18.5) {
            strLevel = "体重过轻";
        } else if (bmi < 24) {
            strLevel="正常范围";
        } else if (bmi < 27) {
            strLevel="轻度肥胖";
        } else if (bmi < 30) {
            strLevel="中度肥胖";
        } else {
            strLevel="重度肥胖";
        }
        return strLevel;
    }

    public static void main(String[] args) {
        double weight,height,BMI;
        weight=72;
        height=1.75;
        BMI=getBMI(weight,height);
        System.out.println("你的BMI为："+BMI);
        System.out.println("你的体重状况为"+getWeightLevel(BMI));
    }
}
